package com.yzc.android.common.utils;

/**
 * Created by 冯子杰(fengzijie@edaijia-inc.cn) Date: 14-8-7
 */
public class StringUtils {
	public static String convertToSecretPhone(String phone) {
		if (phone == null || phone.length() != 11) {
			return null;
		} else {
			return phone.substring(0, 3) + "****" + phone.substring(7, 11);
		}
	}
	
	public static String convertToSecretCarnumber(String carNumber){
		if (carNumber == null || carNumber.length() != 7) {
			return "";
		} else {
			return carNumber.substring(0, 1) + "***" + carNumber.substring(4, 7);
		}
	}
    /**
     * 中文名字判断
     *
     * @param name
     * @return
     */
    public static boolean checkChineseName(String name) {
        return name.matches("^[\u4E00-\u9FFF]{1,4}$");
    }
}
